<template>
	<view class="user-center">
		<view class="header">
			<view class="status_bar"></view>
			<text class="header-title">个人中心</text>
		</view>
		<view class="userinfo">
			<view class="leftUserinfo">
				<view class="leftimg"><u-avatar size="80" src="https://cdn.uviewui.com/uview/album/1.jpg"/></view>
				<view class="rightinfo">
					<p class="username">吹不散的晚风</p>
					<p class="cell-phone">186****1256</p>
					<p class="post">
						<u-icon name="account" color="#2D8EF2"/>
						<text class="postname">物业</text>
						<u-icon name="arrow-right" color="#dfdfdf"/>
					</p>
				</view>
			</view>
			<u-icon name="arrow-right" size="28" color="#ffffff"/>
		</view>
		<view class="cellLists">
			<u-cell-group :border="false">
				<u-cell size="large" :border="false" v-for="(item,index) in celllistDatas" :key="index" icon="share" 
				:title="item.name" :isLink="true" arrow-direction="left" @click="openPage(item)">
					<image class="icon-img" slot="icon" :src="item.iconImg"/>
				</u-cell>
			</u-cell-group>
		</view>
		<c-tab-bar :tabValue="2"/>
	</view>
</template>

<script>
	import CTabBar from '@/components/cTabBar/cTabBar'
	export default {
		name:'User',
		components:{ CTabBar },
		data() {
			return {
				celllistDatas:[
					{name:'个人信息',iconImg:require('@/static/images/userinfo-icon.png'),goPath:''},
					{name:'维修记录',iconImg:require('@/static/images/wxjl-icon.png'),goPath:''},
					
				]
			}
		},
		methods: {
			openPage(val){
				console.log("跳转路径",val)
				// uni.$u.route({
				// 	url: val.goPath,
				// });
			}
		}
	}
</script>
<style>
	/* 当前页面背景色 */
	page{
		background-color: #F8F6F9;
	}
</style>
<style lang="scss" scoped>
	.user-center{
		.header{
			text-align: center;
			&::before{
				content:'';
				width: 120%;
				height: 400rpx;
				position: absolute;
				left: -10%;
				top:0;
				border-radius: 0 0 50% 50%;
				background-color: $u-primary;
			}
			/* #ifdef MP-WEIXIN */
			&::before{
				width: 140%;
				height: 520rpx;
				left: -20%;
			}
			/* #endif */
			.header-title{
				font-size: $uni-font-size-lg;
				line-height: 80rpx;
				color: #ffffff;
				position: relative;
				z-index: 1;
			}
		}
		.userinfo{
			position: relative;
			z-index: 1;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding:40rpx 20rpx 40rpx 60rpx;
		
			.leftUserinfo{
				display: flex;
				align-items: center;
				
				.leftimg{
					border:4rpx solid #ffffff;
					border-radius: 50%;
				}
				.rightinfo{
					padding:0 20rpx;
					.username{
						color: #FFFFFF;
						font-size: $uni-font-size-lg;
					}
					.cell-phone{
						color: $uni-text-color-light;
						font-size: $uni-font-size-base;
						padding:10rpx 0 16rpx;
					}
					.post{
						float: left;
						background-color: #f4f4f4;
						display: flex;
						padding:6rpx 10rpx;
						border-radius: 30rpx;
						.postname{
							font-size: $uni-font-size-sm;
							color: $uni-text-color-grey;
							padding:0 10rpx;
						}
						
					}
				}
			}
		}
		.cellLists{
			background-color: #ffffff;
			margin:0 40rpx;
			border-radius: $uni-border-radius-base;
			padding:20rpx 0;
			position: relative;
			z-index: 1;
			.icon-img{
				width: 34rpx;
				height: 34rpx;
				margin-right: 10rpx;
			}
		}
	}

</style>
